package com.edfu.core.identitymgt.persistence.api;

import java.util.Collection;
import java.util.List;

import com.edfu.core.identitymgt.persistence.entity.IIdentityMgtEntity;
import com.edfu.core.identitymgt.persistence.entity.PermissionEntity;
import com.edfu.core.identitymgt.persistence.entity.RoleEntity;
import com.edfu.core.identitymgt.persistence.entity.UserEnrollmentEntity;
import com.edfu.core.identitymgt.persistence.entity.UserEntity;
import com.edfu.core.identitymgt.vo.Permission;
import com.edfu.core.identitymgt.vo.RolePermission;

public interface IIdentityMgtPersistence {

	UserEntity getUser(String userId);

	RoleEntity getRole(String roleName);
	
	void persist(IIdentityMgtEntity entity);
	
	UserEnrollmentEntity getUserEnrollment(String userId, String roleName); 
	
	List<UserEnrollmentEntity> getRoles(String userId);

	PermissionEntity getPermission(Permission permission);

	void assignPermission(RolePermission rolePermission);

	Collection<? extends PermissionEntity> getPermissions(RoleEntity role);

}
